package bishi360;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

/**
 * Created by JiaJia on 2019/8/31 0031.
 */
public class SubString {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        while (scanner.hasNext()){
            String s=scanner.nextLine();
            System.out.println(subString(s));
        }
        scanner.close();
    }
    private static int subString(String str){
        char[] ch=str.toCharArray();
        Map<Character,Integer> map=new HashMap<>();
        for (Character c:ch) {
            map.put(c,map.getOrDefault(c,0)+1);
        }
        int max=0;
        for (Character c2:map.keySet()) {
            int frequency=map.get(c2);
            max=Math.max(max,frequency);
        }
        return max;
    }
}